package de.logicline.cvss.ui.popup.action;

import java.util.List;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;

public class ResourceVisitor implements IResourceVisitor {
		List lst = null;

		public ResourceVisitor(List lst) {
			this.lst = lst;
		}

		/*
		 * (non-Javadoc)
		 * 
		 * @see org.eclipse.core.resources.IResourceVisitor#visit(org.eclipse.core.resources.IResource)
		 */
		public boolean visit(IResource resource) throws CoreException {
			if (resource.getType() == IResource.PROJECT) {
				return true;
			} else if (resource.getType() == IResource.FOLDER) {
				return true;
			} else if (resource.getType() == IResource.FILE) {
				this.lst.add(resource);
				return false;
			}
			return false;
		}
	}